extends Node2D


static var cards = [
	CangLanJian.CreateCardData(),
	DuanTiWuZhe.CreateCardData(),
	FengJianKe.CreateCardData(),
	#JianKe.CreateCardData(),
	XiaoShiMei.CreateCardData(),
	ZhuJianShi.CreateCardData()
]


func _ready() -> void:

	cards.shuffle()
	
	$Card1.setData(cards[0])
	$Card2.setData(cards[1])
	$Card3.setData(cards[2])
	
	$ChooseButton1.pressed.connect(onChoose1)
	$ChooseButton2.pressed.connect(onChoose2)
	$ChooseButton3.pressed.connect(onChoose3)
	
	$GiveUpButton.pressed.connect(close)
	

func onChoose1():
	HandGroup.Inst.addCard($Card1, true)
	close()

func onChoose2():
	HandGroup.Inst.addCard($Card2, true)
	close()

func onChoose3():
	HandGroup.Inst.addCard($Card3, true)
	close()
	
	
func close():
	queue_free()
